Draw the handle with the right orientation, depending on the position of
authorMatthias Clasen <mclasen@redhat.com>
Sun, 24 Dec 2006 05:34:38 +0000 (05:34 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 24 Dec 2006 05:34:38 +0000 (05:34 +0000)
2006-12-24  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkhandlebox.c (draw_textured_frame): Draw the
        handle with the right orientation, depending on the
        position of the handlebox.  (#159764, Benjamin Berg)

ChangeLog
gtk/gtkhandlebox.c

index 07aa9703e01f3ed581cd4195f4280bd6766b4822..426722957fd3fc356ee196be52e5ad14f94fe4df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-24  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Draw the
+       handle with the right orientation, depending on the
+       position of the handlebox.  (#159764, Benjamin Berg)
+
 2006-12-24  Behdad Esfahbod  <behdad@gnome.org>
 
        * gtk/gtkstyle.c (gtk_border_copy), (gtk_border_free): Use gslice for
index fc1bd49c8001efeaecc1a4a994ffb8d85ad93021..93bfe3ab39a2aae4bb11f6bbbe22862a6236df38 100644 (file)
@@ -744,12 +744,12 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb)
 
 static void
 draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow,
-                    GdkRectangle *clip)
+                    GdkRectangle *clip, GtkOrientation orientation)
 {
    gtk_paint_handle (widget->style, window, GTK_STATE_NORMAL, shadow,
                     clip, widget, "handlebox",
                     rect->x, rect->y, rect->width, rect->height, 
-                    GTK_ORIENTATION_VERTICAL);
+                    orientation);
 }
 
 void
@@ -861,6 +861,7 @@ gtk_handle_box_paint (GtkWidget      *widget,
   GdkRectangle rect;
   GdkRectangle dest;
   gint handle_position;
+  GtkOrientation handle_orientation;
 
   bin = GTK_BIN (widget);
   hb = GTK_HANDLE_BOX (widget);
@@ -899,31 +900,36 @@ gtk_handle_box_paint (GtkWidget      *widget,
       rect.y = 0; 
       rect.width = DRAG_HANDLE_SIZE;
       rect.height = height;
+      handle_orientation = GTK_ORIENTATION_VERTICAL;
       break;
     case GTK_POS_RIGHT:
       rect.x = width - DRAG_HANDLE_SIZE; 
       rect.y = 0;
       rect.width = DRAG_HANDLE_SIZE;
       rect.height = height;
+      handle_orientation = GTK_ORIENTATION_VERTICAL;
       break;
     case GTK_POS_TOP:
       rect.x = 0;
       rect.y = 0; 
       rect.width = width;
       rect.height = DRAG_HANDLE_SIZE;
+      handle_orientation = GTK_ORIENTATION_HORIZONTAL;
       break;
     case GTK_POS_BOTTOM:
       rect.x = 0;
       rect.y = height - DRAG_HANDLE_SIZE;
       rect.width = width;
       rect.height = DRAG_HANDLE_SIZE;
+      handle_orientation = GTK_ORIENTATION_HORIZONTAL;
       break;
     }
 
   if (gdk_rectangle_intersect (event ? &event->area : area, &rect, &dest))
     draw_textured_frame (widget, hb->bin_window, &rect,
                         GTK_SHADOW_OUT,
-                        event ? &event->area : area);
+                        event ? &event->area : area,
+                        handle_orientation);
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     (* GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->expose_event) (widget, event);